<template>
	<x-border ref="xBorder" :title="tableConfig.name" icon="icon-5333-yeifen" v-if="tableConfig&&tableConfig.type">
		<x-table ref="xTable" @afterTableLoad="afterTableLoad" :type='tableConfig.type'></x-table>
	</x-border>
</template>


<script>
	import './var.scss'
	import ala from 'ala'
	export default {
		name: 'admin-lightapp-table',
		data() {
			return {
				tableConfig: {
					type: null,
					name: ''
				}
			}
		},
		mounted() {
			this.init()
		},
		methods: {
			async init() {
				this.tableConfig.type = this.$api.lightAppType(this.$route.query)
			},
			// 表格加载完成事件
			afterTableLoad(dataResult) {
				this.$refs.xTable.loading = false
				this.$nextTick(() => {
					var border = this.$ala.getBorder(dataResult.border)
					this.$refs.xBorder.init(border)
				})
			}
		}
	}
</script>